//
//  ByViewMyCouponsSectionHeader.m
//  mijifen_ios
//
//  Created by 朱凯 on 2017/10/26.
//  Copyright © 2017年 itboye. All rights reserved.
//

#import "ByViewMyCouponsSectionHeader.h"

@implementation ByViewMyCouponsSectionHeader
{
    UILabel *_titleLabel;
}
- (instancetype)initWithFrame:(CGRect)frame {
    
    if (self = [super initWithFrame:frame]) {
        
        [self setupUI];
    }
    return self;
}
- (void)setupUI {
    
    _titleLabel = [[UILabel alloc] init];
    _titleLabel.backgroundColor = [UIColor whiteColor];
    _titleLabel.numberOfLines = 0;
    _titleLabel.text = @"";
    _titleLabel.font = FONT(14);
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    _titleLabel.textColor = [UIColor lightGrayColor];
    [self addSubview:_titleLabel];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self).insets(UIEdgeInsetsMake(10, 0, 10, 0));
    }];
}
- (void)setStatus:(NSInteger)status {
    
    if (status == 0) {
        _titleLabel.text = @"优惠券只能线上商城使用哦~";
        _titleLabel.backgroundColor = [UIColor clearColor];
        _titleLabel.textColor = BY_RED_COLOR;
    }
    else {
        _titleLabel.backgroundColor = [UIColor whiteColor];
        _titleLabel.textColor = [UIColor lightGrayColor];
        
        if (status == 1) {
            _titleLabel.text = @"已使用的优惠券";
        }
        else if (status == 2) {
            _titleLabel.text = @"已过期的优惠券";
        }
    }
}

@end
